<template>
  <div class="wrapper">
    <div style="margin: 150px auto; width: 350px;height: 300px;padding: 20px;border-radius: 10px">
      <div style="margin: 20px 0;text-align: center;font-size: 30px;color: white"><b>注 册</b></div>
      <el-input placeholder="请输入注册账号" size="medium" style="margin: 10px 0" prefix-icon="el-icon-user" v-model="user.account"></el-input>
      <el-input placeholder="请输入注册密码" size="medium" style="margin: 10px 0" prefix-icon="el-icon-lock" show-password v-model="user.password"></el-input>
      <el-radio-group v-model="user.userType">
        <el-radio :label="1">我是买家</el-radio>
        <el-radio :label="2">我是卖家</el-radio>
      </el-radio-group>
      <div style="margin: 10px; text-align: center">
        <el-button type="primary" size="small" autocomplete="off" @click="signup">确定</el-button>
        <el-button type="warning" size="small" autocomplete="off" @click="$router.push('/')">取消</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      user: {
        account: '',
        password:'',
        userType:''
      }
    }
  },
  methods: {
    signup() {
      console.log(this.user)
      axios.post('http://127.0.0.1:3049/LoginDetails/insert', this.user).then(function (response) {
        console.log(response.data)
        if(response.data.code==200) {
          
        }
        
      })
      this.$router.push('/');
    }
  }
}
</script>

<style>
.wrapper{
  background:url("./pic/background.jpg");
  width:100%;
  height:100%;
  position:fixed;
  background-size:100% 100%;
}

</style>